Functional Programming in Scala

Functional Programming in Scala

  • Downloads:6561
  • Type:Epub+TxT+PDF+Mobi
  • Create Date:2022-05-01 09:54:06
  • Update Date:2025-09-06
  • Status:finish
  • Author:Rúnar Bjarnason
  • ISBN:1617290653
  • Environment:PC/Android/iPhone/iPad/Kindle

Summary

Functional programming (FP) is a programming style emphasizing functions that return consistent and predictable results regardless of a program's state。 As a result, functional code is easier to test and reuse, simpler to parallelize, and less prone to bugs。 Scala is an emerging JVM language that offers strong support for FP。 Its familiar syntax and transparent interoperability with existing Java libraries make Scala a great place to start learning FP。

Functional Programming in Scala is a serious tutorial for programmers looking to learn FP and apply it to the everyday business of coding。 The book guides readers from basic techniques to advanced topics in a logical, concise, and clear progression。 In it, they'll find concrete examples and exercises that open up the world of functional programming。

Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning。 Also available is all code from the book。

Download

Reviews

Rafa

Somehow hardcore but beautiful!

Christian

need to read it again sometime。doing some of the exercises should help with really understanding the concepts。nonetheless, just reading is fun enough, and some things will stick -- hopefully ;)

Renanreismartins

Can be a continuation for the "Functional programming in java" (blue cover), this books has way more advanced concepts and requires much more experience in fp Can be a continuation for the "Functional programming in java" (blue cover), this books has way more advanced concepts and requires much more experience in fp 。。。more

Banner B Schafer

This book challenged the way I thought about programming and building software。 It forced me to think deeply about FP techniques and the tradeoffs I accept by not using FP。 This book deserves a lot of attention。 I would not recommend reading through FP in Scala like a book。 You should expect to spend a significant amount of time doing exercises and reviewing the example source listings。

Kane See

This is not a book about scala!It is a book about functional programming。 It's quite challenging, especially if you're new to both functional programming and scala。 I'd recommend reading scala first and then diving into this one。The book is probably good, I just don't have enough experience to appreciate it。 I think I will read it again one day。 I wish the title didn't include "scala" in it。 I want to make sure people trying to learn scala don't pick up this book as their first resource。 This is not a book about scala!It is a book about functional programming。 It's quite challenging, especially if you're new to both functional programming and scala。 I'd recommend reading scala first and then diving into this one。The book is probably good, I just don't have enough experience to appreciate it。 I think I will read it again one day。 I wish the title didn't include "scala" in it。 I want to make sure people trying to learn scala don't pick up this book as their first resource。 。。。more

Dorum

This is a great book to learn functional programming via Scala。 It is not about learning Scala,but functional programming。 More importantly it contains tons of exercises。 I guess I will keep on doing them for quite a while, since I skipped over many of them。It makes a great job explaining concepts which seem daunting like monads, referential transparency, effects, etc。I was programming in Scala for some time, and for me this was really the most adequate moment。 I wouldn't recommend it to a begin This is a great book to learn functional programming via Scala。 It is not about learning Scala,but functional programming。 More importantly it contains tons of exercises。 I guess I will keep on doing them for quite a while, since I skipped over many of them。It makes a great job explaining concepts which seem daunting like monads, referential transparency, effects, etc。I was programming in Scala for some time, and for me this was really the most adequate moment。 I wouldn't recommend it to a beginner, but for deepening you knowledge it is pure (functional) gold。 。。。more

Shawn

A bit more academic and abstract then I'd like (but what I was expecting, really, given the book's topic)。 And it would have been nice if the exercise answers were included in the text。 If a high-level, abstract discussion of functional programming is what you're after, this definitely fills the bill。 If you want to learn scala (or even functional scala), it might not be the right fit。 A bit more academic and abstract then I'd like (but what I was expecting, really, given the book's topic)。 And it would have been nice if the exercise answers were included in the text。 If a high-level, abstract discussion of functional programming is what you're after, this definitely fills the bill。 If you want to learn scala (or even functional scala), it might not be the right fit。 。。。more

Damien Buren

This had lots of good, practical advice。

Pramodh Nanjayya

It is a hard book to read and grasp in one go。 It requires grokking。 You have to go through it multiple times and reading and re reading。 I had to skim as the chapters progressed。 One needs to practice what is given and the authors build on top of it。 It is deeply rewarding as you work through the problems and discover the gems as the author mentions it。 The authors demonstrate what is possible with a few lines of code。 Purely genius。 I will return back to it again after the first skim。

Nikolajs

Powerfull book, not for fast reading。 A bit hard to read if you make some pauses between chapters since they are logically connected and referenced by each other。 Doing exercises and trying given samples is a must, otherwise it is easy to run out of context

Haoyu He

hard but fun

Anil Thaplar

I would have given all the stars of the world to this book。 Difficult read but a brilliant book I don’t say I have read completely。 It takes months or years to get this whole thing。 This book is tremendous contribution to “purely” style functional programming。 If you wish to learn Haskell I recommended going Scala route and working through this book!!!

Mark Reynolds

This book is hard, the first 6 chapters will set you up with a lot of information in scala and give you tools to understand the more functional aspects of scala。 If there is one issue it's sometimes hard to see the purpose of the exercises at first and it's easy to become dejected and confused so I have had to read the first 6 chapters 4 times to get a grip on what is being taught。 The next three parts of the book really go into functional programming but so far I have struggled with reading the This book is hard, the first 6 chapters will set you up with a lot of information in scala and give you tools to understand the more functional aspects of scala。 If there is one issue it's sometimes hard to see the purpose of the exercises at first and it's easy to become dejected and confused so I have had to read the first 6 chapters 4 times to get a grip on what is being taught。 The next three parts of the book really go into functional programming but so far I have struggled with reading them, though I haven't given up。 。。。more

0vai5

This is one of the best book to learn (typed)functional programming。 I found it to be even better than some of the books available in Haskell。- It starts slowly but gets quite dense as it proceeds to the later chapters。- Learn Building infinite streams using scala constructs! This is quite helpful in understanding laziness。 Though I enjoyed building infinite streams in SICP more, the coverage in FP in scala book turned out quite decent。- The second part builds three very different libraries usin This is one of the best book to learn (typed)functional programming。 I found it to be even better than some of the books available in Haskell。- It starts slowly but gets quite dense as it proceeds to the later chapters。- Learn Building infinite streams using scala constructs! This is quite helpful in understanding laziness。 Though I enjoyed building infinite streams in SICP more, the coverage in FP in scala book turned out quite decent。- The second part builds three very different libraries using FP and discover similar abstractions in each of them。 We learn to discover the minimum set of primitive operations required for each of these libraries。 We understand that why we need laws for the operations library will support and identifying the minimum set of laws。- In third part we 'name' the abstractions that we found in the libraries built in part 2。- One of the best coverage on Monads。 This book puts it in words that why it is difficult to understand monads and every time we read them - it feels like - “OK, I thought I understood monads before, but now I really get it。” :)。 In exercises it then showcases this problem of monads understanding by asking the reader to explain in words what monad operations do in different contexts。- Exercises are quite decent and an integral part of the book。 I found most of the exercises quite approachable and at the right level of difficulty needed to grasp the concept。- I really appreciate the work for providing the exercises as well as solutions on github and make them available with the required build setup so that any one can compile and execute without much hassle。- I learned most of the topics covered in the last part: localized effect(using types to make sure effects are local), StreamingIO for the "first time"。 This gave me an opportunity to see how well I can learn complete new topics from this book。 It turns out that apart from some parts of last chapter I was able to follow through without much difficulty。 However, I think last chapter could be improved to make it more approachable。- I am yet to develop my taste buds for Scala syntax。 As of now, it does not look clean and perhaps the OOPs part of Scala is to blame。 I hope for a similar kind of book in Haskell。 Perhaps there is already one that I am not aware of。 Well, for this book I can go as far as that if one has to learn Scala only to read this book then so be it! 。。。more

Adrian Salajan

If you want to learn pure functional programming, this is the book!No prior FP knowledge needed。 All concepts are wonderfully explained。 Lots of exercises that MUST NOT be skipped。

DANIEL

Very interesting book, but I found it a little bit overwhelming if you don't have a very good foundations of functional programming。 I don't recommended this book for learning FP, but it is a really interested one if you one to improve your skills in Scala (FP flavour) Very interesting book, but I found it a little bit overwhelming if you don't have a very good foundations of functional programming。 I don't recommended this book for learning FP, but it is a really interested one if you one to improve your skills in Scala (FP flavour) 。。。more

Pahlevi

One of the advanced level book I'd recommend。 Despite the title, having experience with Scala is not prerequisite of this book。 Good book to learn about functional thinking。 One of the advanced level book I'd recommend。 Despite the title, having experience with Scala is not prerequisite of this book。 Good book to learn about functional thinking。 。。。more

António Silva

Great book,but very dense, and challenging。Read twice and probably will need to read again the last part。I would recommend to start by Haskell first。 Is more natural

Lino

Love this book。 Scala was conceived as a fusion between OO and Functional, and no other book I've read expresses it as well as "the red book"。It's not perfect though, but that's a personal preference。 The second part of the book - and to a lesser extent the third too - exposes problems in a non-linear way。 This is intentional。 The author wants to simulate the somewhat meandering journey of coming up with an API。 But to me the dead ends and frequent breaks to write exercises distract from the lar Love this book。 Scala was conceived as a fusion between OO and Functional, and no other book I've read expresses it as well as "the red book"。It's not perfect though, but that's a personal preference。 The second part of the book - and to a lesser extent the third too - exposes problems in a non-linear way。 This is intentional。 The author wants to simulate the somewhat meandering journey of coming up with an API。 But to me the dead ends and frequent breaks to write exercises distract from the larger picture。 This encumbers skimming the book later for reference。 I would have preferred exercises were kept to a minimum from the second part onwards, and preferably at the end of the chapters or major sections。 Again, this is probably just personal learning style。This is my second run through this book, and I'll probably pick it up again in the future。 。。。more

Swaraj Yadav

This is the fp book I will come back to again and again, I have only finished half of it for now, and It has already improved the thinking and code structures for me。。。 I will come back。

Fran Armijo

Hyper-dense book。 Full of examples and well explained, but a challenging one。And, although the "。。。 in Scala" subtitle, this is not an Scala book。 It assumes that you know previously about its syntax and behavior without caring on explaining anything related to them。 Take a look to Scala language first; this is a challenging book by itself, you don't want to over-complicate it。 Hyper-dense book。 Full of examples and well explained, but a challenging one。And, although the "。。。 in Scala" subtitle, this is not an Scala book。 It assumes that you know previously about its syntax and behavior without caring on explaining anything related to them。 Take a look to Scala language first; this is a challenging book by itself, you don't want to over-complicate it。 。。。more

Antonio Molner

Such a pretty good book。 It goes through the most common FP structures in a friendly way and it's plenty of exercises。 I encourage to read it。 Such a pretty good book。 It goes through the most common FP structures in a friendly way and it's plenty of exercises。 I encourage to read it。 。。。more

Rutvik Patel

The most *CHALLENGING* and *REWARDING* book I've ever read on programming。 Content of the book is extremely dense and authors have often been reminding - almost in every chapter since part I - "Don't worry too much about following absolutely everything in this section" and it's pretty much assuring。 Exercises are the key elements。 Its a part of the content so don't leave it, otherwise you are going to be stuck in sections to come。Here is a quote from chapter I "Functional programming is based on The most *CHALLENGING* and *REWARDING* book I've ever read on programming。 Content of the book is extremely dense and authors have often been reminding - almost in every chapter since part I - "Don't worry too much about following absolutely everything in this section" and it's pretty much assuring。 Exercises are the key elements。 Its a part of the content so don't leave it, otherwise you are going to be stuck in sections to come。Here is a quote from chapter I "Functional programming is based on a simple premise with far-reaching implications" and authors have succeeded in showing that it is the case。I have enjoyed the book immensely and sometime felt annoyed, of course because of my limitations of understanding the material。 But the formula is - keep reading - if you get stuck on some section, put it down and read it again after couple of weeks。 Book will make you a better programmer that's guaranteed。 。。。more

Erkin Unlu

Bitirir bitirmez yazdığım bir kaç cümlenin üzerinden tekrar geçmek istiyorum。 Öncelikle bu kitap bir Scala kitabı değil, Scala ile fonksiyonel programlama kitabı。 Scala biliyor olmak kesinlikle gerekli。 İkincisi bu kitap sadece okunarak bir şeyler elde edilecek bir kitap değil。 Her bölümde en az 10 adet yapılması gereken çalışma var。 Bunları yapmadığınız zaman zaten hem konuyu anlamıyorsunuz hem de sonraki bölümler bu konu ve kavramları devam ettirdiği için takılmaya başlıyorsunuz。 Ben açıkcası Bitirir bitirmez yazdığım bir kaç cümlenin üzerinden tekrar geçmek istiyorum。 Öncelikle bu kitap bir Scala kitabı değil, Scala ile fonksiyonel programlama kitabı。 Scala biliyor olmak kesinlikle gerekli。 İkincisi bu kitap sadece okunarak bir şeyler elde edilecek bir kitap değil。 Her bölümde en az 10 adet yapılması gereken çalışma var。 Bunları yapmadığınız zaman zaten hem konuyu anlamıyorsunuz hem de sonraki bölümler bu konu ve kavramları devam ettirdiği için takılmaya başlıyorsunuz。 Ben açıkcası bu kitabı mayıstan beri günlük egzersiz rutini biçiminde bilgisayardan okuyarak ve favori IDE'mi kullanarak güç bela bitirdim。 Diğer yandan ise fonksiyonel programlamanın gücünü tam olarak görebileceğiniz bir kitap。 Neden monad, functor vs yapıları kullanmamız gerektiğini gerçek örneklerden yola çıkarak anlatması takdire şayan。 Kitapla ilgili tek eleştirim ise, aşırı zor olması。 Kitap sadece 300 sayfa ama 6 aydır haftada en az 3-4 saat üzerinde çalışarak ve bu süreçte sanırım en az 1000 satır Scala yazarak anca bitirdim。 Verilen problemlerin de tabii ki hepsini yapamadım。 Gene de Fonksiyonel Programlama ile ciddi ilgilenen herkesin kesinlikle okuması değil, çalışması gereken bir kitap。 。。。more

Zoltán Elek

A comprehensive book I'd recommend for anyone wanting to get into the world of Scala。For those who haven't made up their mind, I would recommend the now open-source Underscore books, but this gives a more in-depth knowledge about the language with more examples and exercises。 A comprehensive book I'd recommend for anyone wanting to get into the world of Scala。For those who haven't made up their mind, I would recommend the now open-source Underscore books, but this gives a more in-depth knowledge about the language with more examples and exercises。 。。。more

Ignacio

A must-read if you want to get the most out of Scala functional capabilities。In order to get from the premise to the final implementations it uses a nice incremental approach where every step is both useful and meaningful。 It's as concise and to-the-point as it can be, which also makes this a really dense book。I'll keep revisiting it for a long time, in order to grasp its concepts by rereading and doing every exercise。 A must-read if you want to get the most out of Scala functional capabilities。In order to get from the premise to the final implementations it uses a nice incremental approach where every step is both useful and meaningful。 It's as concise and to-the-point as it can be, which also makes this a really dense book。I'll keep revisiting it for a long time, in order to grasp its concepts by rereading and doing every exercise。 。。。more

Emre Sevinç

It is safe to say that “Functional Programming in Scala” by Chiusano and Bjarnason can be considered the most advanced Scala programming book published so far (in a sense, it can be compared to SICP。)。 Half of one of my bookshelves is occupied by Scala books, including Scala in Depth, but none of them takes the concept of functional programming as serious as this book, and pushes it to its limits that much。 This, in turn, means that most of the Java programmers (including very senior ones), as w It is safe to say that “Functional Programming in Scala” by Chiusano and Bjarnason can be considered the most advanced Scala programming book published so far (in a sense, it can be compared to SICP。)。 Half of one of my bookshelves is occupied by Scala books, including Scala in Depth, but none of them takes the concept of functional programming as serious as this book, and pushes it to its limits that much。 This, in turn, means that most of the Java programmers (including very senior ones), as well as Scala programmers with some experience should prepare themselves to feel very much like a newbie again。But why the need for such a book, and what’s all that noise about functional programming? Here is my favorite description of functional programming given by Tony Morris : “Supposing a program composed of parts A, B, C, D, and a requirement for program of parts A, B, C, and E。 The effort required to construct this program should be proportional to the size of E。 The extent to which this is true is the extent to which one achieves the central thesis of Functional Programming。 Identifying independent program parts requires very rigorous cognitive discipline and correct concept formation。 This can be very (very) difficult after exposure to sloppy thinking habits。 Composable programs are easier to reason about。 We may (confidentally) determine program behaviour by determining the behaviour of sub-programs -> fewer bugs。 Composable programs scale indefinitely, by composing more and more sub-programs。 There is no distinction between a ‘small’ and a ‘large’ application; only ‘smaller than’ or ‘greater than’。”The description above not only points at the core idea of functional programming and why that is important, as well as useful, but also draws attention to the fact that getting used to functional programming design can be difficult for people who are not used to thinking that way。 Fortunately, “Functional Programming in Scala” is here to fill a huge void in that respect。The book can be considered one of its kind, not only because of its strong logical foundations, starting from first principles and rigorously following them to their consequences, but also for its pedagogical approach。 Even though it is aimed at practicing programmers and not academics, every chapter includes a lot of exercises arranged in a very nice developmental manner。 But make no mistake, this also means that you cannot simply read that book, you can only study it。 This, in turn, means that the only way to read the book is to run your favorite Scala coding environment, grab the exercises’ source code (and in case you are stuck, hints, as well as answers) from https://github。com/fpinscala/fpinscala, and start solving the exercise by implementing the required functions and other stubs。 Moreover, you should do yourself a favor and also take into account the extra reading at https://github。com/fpinscala/fpinscal。。。。Depending on your level of Scala, e。g。 if you have successfully completed the Coursera course titled “Functional Programming Principles in Scala” by Odersky, you can finish the first few chapters and exercises relatively quickly, but I would suggest to take your time after the first few chapters, 1-2 weeks per chapter will probably be an adequate pace for experienced programmers。I can recommend this book to serious, curious, brave,and open-minded developers who target JVM by using Scala, and want less duplication, less boilerplate and much more powerful abstractions that are also easier to reason about, and who are ready to invest time to slowly digest the material by doing exercises instead of trying to quickly skim the text。 。。。more

Bjoern Rochel

1 1/2 years later I've at least read through the content。 I'm still far from done with all the exercises。 I'll probably give me another year to do that 😂The best side of the book is also its worst。 It really hammers the content into the head with small steps and repetition in exercises。 But this is a time sink。 Must people don't have the time。 Even I gave up on this book since once, since it was too time consuming。But the content is worth it and quite illuminating。 Even if you probably won't wri 1 1/2 years later I've at least read through the content。 I'm still far from done with all the exercises。 I'll probably give me another year to do that 😂The best side of the book is also its worst。 It really hammers the content into the head with small steps and repetition in exercises。 But this is a time sink。 Must people don't have the time。 Even I gave up on this book since once, since it was too time consuming。But the content is worth it and quite illuminating。 Even if you probably won't write Scala like that in the near future 😜 。。。more

Tony Poerio

Don't judge this book by its cover。 Or by its slim profile。 This is an extremely in-depth an challenging deep dive into FP, and it's very hands on。You'll be asked to re-derive and re-implement many features of Scala's standard library。。。 and from first principles。 If you're used to tearing through programming books and learning a language/framework in a weekend。。 then this will leave you frustrated。 (At least in my experience。)But if you sit back, do it in your spare time, and treat it as a long Don't judge this book by its cover。 Or by its slim profile。 This is an extremely in-depth an challenging deep dive into FP, and it's very hands on。You'll be asked to re-derive and re-implement many features of Scala's standard library。。。 and from first principles。 If you're used to tearing through programming books and learning a language/framework in a weekend。。 then this will leave you frustrated。 (At least in my experience。)But if you sit back, do it in your spare time, and treat it as a longterm project -- you'll be slowly rewarded。 (That's how I've been approaching it, and it's been relatively painless/pleasant, after a few false starts。)Also don't be afraid to look online for help。 The author provides hints & answers to the exercises on Github, and even following along can be enlightening。 It would also be helpful to work through this as a group, maybe as a class。 (If only for the emotional support。) 。。。more

Arvind Balasubramaniam

Haven't finished the book but I found it way too hard for my taste。 It could have been renamed "101 scala exercises to practice functional programming with hints"。 It might be more useful for someone who's already had real world experience with functional programming or programming with scala, but for someone who's new to these technologies and paradigms, you will not have much to take from it as it will simply go over your head。 Might come back to this book in a few month's time but if you're a Haven't finished the book but I found it way too hard for my taste。 It could have been renamed "101 scala exercises to practice functional programming with hints"。 It might be more useful for someone who's already had real world experience with functional programming or programming with scala, but for someone who's new to these technologies and paradigms, you will not have much to take from it as it will simply go over your head。 Might come back to this book in a few month's time but if you're a beginner like me, just skip this。 It will save you some time and effort。 。。。more